﻿#!/usr/bin/env python
# coding:utf-8

grade12,grade13,grade14,grade15,grade16,grade17,beijing,gradeold = 0,0,0,0,0,0,0,0


def total(stu_num, oper):
    global grade12,grade13,grade14,grade15,grade16,grade17,gradeold,beijing
    try:
        stu_num = abs(int(stu_num))
    except ValueError, e:
        print '提示:[ 无效字符，请输入4位数字 ]'
    else:
        if stu_num % 100 == 0:
            if stu_num/100 == 15:
                grade16=eval('{}{}1'.format(grade16,oper))
            elif stu_num/100 == 16:
                grade17 = eval('{}{}1'.format(grade17, oper))
            elif stu_num/100 == 14:
                grade15 = eval('{}{}1'.format(grade15, oper))
            elif stu_num/100 == 13:
                grade14 = eval('{}{}1'.format(grade14, oper))
            elif stu_num/100 == 12:
                grade13 = eval('{}{}1'.format(grade13, oper))
            else:
                print '提示:[ 无效数字，不会统计到结果，请输入4位数字 ]'
        elif stu_num % 100 == 18:
            beijing = eval('{}{}1'.format(beijing, oper))
        elif stu_num/100 == 12:
            grade12 = eval('{}{}1'.format(grade12, oper))
        elif stu_num/100 == 13:
            grade13 = eval('{}{}1'.format(grade13, oper))
        elif stu_num/100 == 14:
            grade14 = eval('{}{}1'.format(grade14, oper))
        elif stu_num/100 == 15:
            grade15 = eval('{}{}1'.format(grade15, oper))
        elif stu_num/100 == 16:
            grade16 = eval('{}{}1'.format(grade16, oper))
        elif stu_num/100 == 17:
            grade17 = eval('{}{}1'.format(grade17, oper))
        else:
            print '提示:[ 无效输入，不会统计到结果，请输入4位数字 ]'
while True:
    stu_num = raw_input('输入学号，输入0查看目前统计,输入666退出程序:'.strip())
    if stu_num == '666':
        break
    elif stu_num == '0':
        print '12级:{}\n13级:{}\n14级:{}\n15级:{}\n16级:{}\n17级:{}\n北京学院:{}\n旧版本卡:{}'.format(grade12,grade13,grade14,grade15,grade16,grade17,beijing,gradeold)
    elif stu_num[:1] == '-':
        total(stu_num, '-')
    else:
        total(stu_num, '+')
